package clientView;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Locale;
import java.util.Vector;

import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import objectView.EmSalarySheet;
import objectView.EmTimeSheet;
import objectView.EmployeeInfo;
import uploadServer.UploadImg;
import utility.DayMonthYear;
import utility.StringUtil;
import clientMain.Login;
import clientMain.Main;
import clientUtilGUI.UtilityGUI;

import com.toedter.calendar.JMonthChooser;
import com.toedter.calendar.JYearChooser;

import excel.WriteExcel;

public class Employee_View extends JScrollPane implements ActionListener{
	
	private EmployeeInfo em;
	private String my;
	
	private JPanel panelHeader;
	private JPanel panelMain;
	private GridBagLayout gbl_panelBody;
	
	private JPanel panelBody;
	
	private JPanel panelTitle1;
	private JLabel lblEmId;
	private JLabel lblId;
	private JLabel lblEmFullName;
	private JLabel lblFullName;
	private JLabel lblEmSex;
	private JLabel lblSex;
	private JLabel lblEmBirthday;
	private JLabel lblBirthday;
	private JLabel lblEmCMT;
	private JLabel lblCMT;
	private JLabel lblEmPhone;
	private JLabel lblPhone;
	private JLabel lblEmMoblie;
	private JLabel lblMoblie;
	private JLabel lblEmEmail;
	private JLabel lblEmail;
	private JLabel lblEmHT;
	private JLabel lblHT;
	private JLabel lblEmCur;
	private JLabel lblCur;
	private JLabel lblEmDiplomas;
	private JLabel lblDiplomas;
	private JLabel lblEmSpec;
	private JLabel lblSpec;

	private JPanel panelTitle2;
	private JLabel lblEmDep;
	private JLabel lblDep;
	private JLabel lblEmPos;
	private JLabel lblPos;
	private JLabel lblEmT;
	private JLabel lblType;
	private JLabel lblEmDateStart;
	private JLabel lblDateStart;
	private JLabel lblEmDateEnd;
	private JLabel lblDateEnd;
	
	private JButton btnNext;
	private JButton btnPrev;
	
	private JPanel panelOption;
	private JLabel lblMonth;
	private JMonthChooser monthChooser;
	private JLabel lblYear;
	private JYearChooser yearChooser;
	private JButton btnView;
	
	private JPanel panelTSSS;
	
	private JPanel panelMonthYear;
	
	private JTable tblEmTS;
	private JScrollPane scrollTblTS;
	
	private JPanel panelSS;
	private JLabel lblTotalAM;
	private JLabel lblTotalPM;
	private JLabel lblSCAM;
	private JLabel lblSCPM;
	private JLabel lblSalaryAM;
	private JLabel lblSalaryPM;
	private JLabel lblSB;
	private JLabel lblTotalSalary;
	private JLabel lbl_TotalAM;
	private JLabel lbl_SCAM;
	private JLabel lbl_SalaryAM;
	private JLabel lbl_TotalPM;
	private JLabel lbl_SCPM;
	private JLabel lbl_SalaryPM;
	private JLabel lbl_SB;
	private JLabel lbl_TotalSalary;
	
	private boolean flag = false;
	private JLabel lblNote;
	private JLabel lblImg;
	private JButton btnEmEdit;
	private JRadioButton rdbtnOption;
	private JLabel lblPercent;
	private JLabel lbl_Percent;
	private JLabel lblSCYear;
	private JLabel lbl_SCYear;
	private JLabel lblSalaryYear;
	private JLabel lbl_SalaryYear;
	private JButton btnReport;
	private Vector<EmployeeInfo> vt;
	
	/**
	 * Create the frame.
	 */
	public Employee_View(String emId) {
		setSize(new Dimension(1000, 800));
		em = Main.viewEm.getEmployee(emId);
		vt = Main.viewEm.getEmployee1(emId);
		panelMain = new JPanel();
		panelMain.setLayout(new BorderLayout(0, 0));
		
		panelHeader = UtilityGUI.headerForm("Nhân Viên : "+ em.getEmFullName());
		panelMain.add(panelHeader, BorderLayout.NORTH);
		panelMain.add(initPanelInfo(em), BorderLayout.CENTER);
						
		setBorder(new EmptyBorder(0, 0, 0, 0));
		setViewportView(panelMain);
	}
	
	/**
	 * panel EmployeeInfo
	 * @param em
	 * @return
	 */
	private JPanel initPanelInfo(EmployeeInfo em) {
		panelBody = new JPanel();
		gbl_panelBody = new GridBagLayout();
		gbl_panelBody.columnWidths = new int[]{0, 0, 0, 0, 0};
		gbl_panelBody.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		gbl_panelBody.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 1.0};
		gbl_panelBody.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0};
		panelBody.setLayout(gbl_panelBody);
		
		//	panelTitle1
		panelTitle1 = UtilityGUI.titleForm("Thông Tin Cá Nhân");
		GridBagConstraints gbc_panelTitle1 = new GridBagConstraints();
		gbc_panelTitle1.insets = new Insets(8, 0, 10, 0);
		gbc_panelTitle1.fill = GridBagConstraints.BOTH;
		gbc_panelTitle1.gridx = 0;
		gbc_panelTitle1.gridy = 0;
		gbc_panelTitle1.gridwidth = 5;
		panelBody.add(panelTitle1, gbc_panelTitle1);

		lblEmId = new JLabel("Mã Nhân Viên :");
		lblEmId.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmId = new GridBagConstraints();
		gbc_lblEmId.anchor = GridBagConstraints.WEST;
		gbc_lblEmId.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmId.gridx = 0;
		gbc_lblEmId.gridy = 1;
		panelBody.add(lblEmId, gbc_lblEmId);
		
		lblId = new JLabel(em.getEmId());
		lblId.setFont(UtilityGUI.fontLblForm);
		lblId.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblId = new GridBagConstraints();
		gbc_lblId.anchor = GridBagConstraints.WEST;
		gbc_lblId.insets = new Insets(3, 0, 5, 5);
		gbc_lblId.gridx = 1;
		gbc_lblId.gridy = 1;
		panelBody.add(lblId, gbc_lblId);
		
		if(!em.getEmImage().isEmpty()){
			String srcImg = em.getEmImage();
			srcImg = StringUtil.replace(srcImg, "src", "");
			lblImg = new JLabel("");
			lblImg.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));
			lblImg.setHorizontalAlignment(SwingConstants.CENTER);
			lblImg.setPreferredSize(new Dimension(UploadImg.imgWidth, UploadImg.imgHeight));
			lblImg.setIcon(new ImageIcon(Employee_View.class.getResource(srcImg)));
			GridBagConstraints gbc_lblImg = new GridBagConstraints();
			gbc_lblImg.gridheight = 7;
			gbc_lblImg.anchor = GridBagConstraints.NORTHEAST;
			gbc_lblImg.insets = new Insets(0, 20, 5, 60);
			gbc_lblImg.gridx = 4;
			gbc_lblImg.gridy = 1;
			panelBody.add(lblImg, gbc_lblImg);
		}
		
		lblEmFullName = new JLabel("Họ Tên :");
		lblEmFullName.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmFullName = new GridBagConstraints();
		gbc_lblEmFullName.anchor = GridBagConstraints.WEST;
		gbc_lblEmFullName.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmFullName.gridx = 0;
		gbc_lblEmFullName.gridy = 2;
		panelBody.add(lblEmFullName, gbc_lblEmFullName);
		
		lblFullName = new JLabel(em.getEmFullName());
		lblFullName.setFont(UtilityGUI.fontLblForm);
		lblFullName.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblFullName = new GridBagConstraints();
		gbc_lblFullName.anchor = GridBagConstraints.WEST;
		gbc_lblFullName.insets = new Insets(3, 0, 5, 5);
		gbc_lblFullName.gridx = 1;
		gbc_lblFullName.gridy = 2;
		panelBody.add(lblFullName, gbc_lblFullName);
		
		lblEmSex = new JLabel("Giới Tính :");
		lblEmSex.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmSex = new GridBagConstraints();
		gbc_lblEmSex.anchor = GridBagConstraints.WEST;
		gbc_lblEmSex.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmSex.gridx = 0;
		gbc_lblEmSex.gridy = 3;
		panelBody.add(lblEmSex, gbc_lblEmSex);
		
		lblSex = new JLabel(em.getEmSex());
		lblSex.setFont(UtilityGUI.fontLblForm);
		lblSex.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblSex = new GridBagConstraints();
		gbc_lblSex.anchor = GridBagConstraints.WEST;
		gbc_lblSex.insets = new Insets(3, 0, 5, 5);
		gbc_lblSex.gridx = 1;
		gbc_lblSex.gridy = 3;
		panelBody.add(lblSex, gbc_lblSex);
		
		lblEmBirthday = new JLabel("Ngày Sinh :");
		lblEmBirthday.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmBirthday = new GridBagConstraints();
		gbc_lblEmBirthday.anchor = GridBagConstraints.WEST;
		gbc_lblEmBirthday.insets = new Insets(3, 25, 5, 5);
		gbc_lblEmBirthday.gridx = 2;
		gbc_lblEmBirthday.gridy = 3;
		panelBody.add(lblEmBirthday, gbc_lblEmBirthday);
		
		lblBirthday = new JLabel(em.getEmBirthDay());
		lblBirthday.setFont(UtilityGUI.fontLblForm);
		lblBirthday.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblBirthday = new GridBagConstraints();
		gbc_lblBirthday.anchor = GridBagConstraints.WEST;
		gbc_lblBirthday.insets = new Insets(3, 0, 5, 5);
		gbc_lblBirthday.gridx = 3;
		gbc_lblBirthday.gridy = 3;
		panelBody.add(lblBirthday, gbc_lblBirthday);
		
		lblEmCMT = new JLabel("CMTND :");
		lblEmCMT.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmCMT = new GridBagConstraints();
		gbc_lblEmCMT.anchor = GridBagConstraints.WEST;
		gbc_lblEmCMT.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmCMT.gridx = 0;
		gbc_lblEmCMT.gridy = 4;
		panelBody.add(lblEmCMT, gbc_lblEmCMT);
		
		lblCMT = new JLabel(em.getEmCMTND());
		lblCMT.setFont(UtilityGUI.fontLblForm);
		lblCMT.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblCMT = new GridBagConstraints();
		gbc_lblCMT.anchor = GridBagConstraints.WEST;
		gbc_lblCMT.insets = new Insets(3, 0, 5, 5);
		gbc_lblCMT.gridx = 1;
		gbc_lblCMT.gridy = 4;
		panelBody.add(lblCMT, gbc_lblCMT);
		
		lblEmPhone = new JLabel("ĐT Nhà :");
		lblEmPhone.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmPhone = new GridBagConstraints();
		gbc_lblEmPhone.anchor = GridBagConstraints.WEST;
		gbc_lblEmPhone.insets = new Insets(3, 25, 5, 5);
		gbc_lblEmPhone.gridx = 2;
		gbc_lblEmPhone.gridy = 4;
		panelBody.add(lblEmPhone, gbc_lblEmPhone);
		
		lblPhone = new JLabel(em.getEmPhone());
		lblPhone.setFont(UtilityGUI.fontLblForm);
		lblPhone.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblPhone = new GridBagConstraints();
		gbc_lblPhone.anchor = GridBagConstraints.WEST;
		gbc_lblPhone.insets = new Insets(3, 0, 5, 5);
		gbc_lblPhone.gridx = 3;
		gbc_lblPhone.gridy = 4;
		panelBody.add(lblPhone, gbc_lblPhone);
		
		lblEmMoblie = new JLabel("ĐTDĐ :");
		lblEmMoblie.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmMoblie = new GridBagConstraints();
		gbc_lblEmMoblie.fill = GridBagConstraints.VERTICAL;
		gbc_lblEmMoblie.anchor = GridBagConstraints.WEST;
		gbc_lblEmMoblie.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmMoblie.gridx = 0;
		gbc_lblEmMoblie.gridy = 5;
		panelBody.add(lblEmMoblie, gbc_lblEmMoblie);
		
		lblMoblie = new JLabel(em.getEmMobile());
		lblMoblie.setFont(UtilityGUI.fontLblForm);
		lblMoblie.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblMoblie = new GridBagConstraints();
		gbc_lblMoblie.fill = GridBagConstraints.VERTICAL;
		gbc_lblMoblie.anchor = GridBagConstraints.WEST;
		gbc_lblMoblie.insets = new Insets(3, 0, 5, 5);
		gbc_lblMoblie.gridx = 1;
		gbc_lblMoblie.gridy = 5;
		panelBody.add(lblMoblie, gbc_lblMoblie);
		
		lblEmEmail = new JLabel("Email :");
		lblEmEmail.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmEmail = new GridBagConstraints();
		gbc_lblEmEmail.fill = GridBagConstraints.VERTICAL;
		gbc_lblEmEmail.anchor = GridBagConstraints.WEST;
		gbc_lblEmEmail.insets = new Insets(3, 25, 5, 5);
		gbc_lblEmEmail.gridx = 2;
		gbc_lblEmEmail.gridy = 5;
		panelBody.add(lblEmEmail, gbc_lblEmEmail);
		
		lblEmail = new JLabel(em.getEmEmail());
		lblEmail.setFont(UtilityGUI.fontLblForm);
		lblEmail.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblEmail = new GridBagConstraints();
		gbc_lblEmail.fill = GridBagConstraints.VERTICAL;
		gbc_lblEmail.anchor = GridBagConstraints.WEST;
		gbc_lblEmail.insets = new Insets(3, 0, 5, 5);
		gbc_lblEmail.gridx = 3;
		gbc_lblEmail.gridy = 5;
		panelBody.add(lblEmail, gbc_lblEmail);
		
		lblEmHT = new JLabel("Quê Quán :");
		lblEmHT.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmHT = new GridBagConstraints();
		gbc_lblEmHT.anchor = GridBagConstraints.WEST;
		gbc_lblEmHT.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmHT.gridx = 0;
		gbc_lblEmHT.gridy = 6;
		panelBody.add(lblEmHT, gbc_lblEmHT);
		
		lblHT = new JLabel(em.getEmHT());
		lblHT.setFont(UtilityGUI.fontLblForm);
		lblHT.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblHT = new GridBagConstraints();
		gbc_lblHT.anchor = GridBagConstraints.WEST;
		gbc_lblHT.gridwidth = 4;
		gbc_lblHT.insets = new Insets(3, 0, 5, 0);
		gbc_lblHT.gridx = 1;
		gbc_lblHT.gridy = 6;
		panelBody.add(lblHT, gbc_lblHT);
		
		lblEmCur = new JLabel("Địa Chỉ Hiện Tại :");
		lblEmCur.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmCur = new GridBagConstraints();
		gbc_lblEmCur.anchor = GridBagConstraints.WEST;
		gbc_lblEmCur.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmCur.gridx = 0;
		gbc_lblEmCur.gridy = 7;
		panelBody.add(lblEmCur, gbc_lblEmCur);
		
		lblCur = new JLabel(em.getEmCur());
		lblCur.setFont(UtilityGUI.fontLblForm);
		lblCur.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblCur = new GridBagConstraints();
		gbc_lblCur.gridwidth = 4;
		gbc_lblCur.anchor = GridBagConstraints.WEST;
		gbc_lblCur.insets = new Insets(3, 0, 5, 0);
		gbc_lblCur.gridx = 1;
		gbc_lblCur.gridy = 7;
		panelBody.add(lblCur, gbc_lblCur);
		
		lblEmSpec = new JLabel("Chuyên Ngành :");
		lblEmSpec.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmSpec = new GridBagConstraints();
		gbc_lblEmSpec.anchor = GridBagConstraints.WEST;
		gbc_lblEmSpec.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmSpec.gridx = 0;
		gbc_lblEmSpec.gridy = 8;
		panelBody.add(lblEmSpec, gbc_lblEmSpec);
		
		lblSpec = new JLabel(em.getSpecName());
		lblSpec.setFont(UtilityGUI.fontLblForm);
		lblSpec.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblSpec = new GridBagConstraints();
		gbc_lblSpec.anchor = GridBagConstraints.WEST;
		gbc_lblSpec.insets = new Insets(3, 0, 5, 5);
		gbc_lblSpec.gridx = 1;
		gbc_lblSpec.gridy = 8;
		panelBody.add(lblSpec, gbc_lblSpec);

		
		lblEmDiplomas = new JLabel("Bằng Cấp :");
		lblEmDiplomas.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmDiplomas = new GridBagConstraints();
		gbc_lblEmDiplomas.anchor = GridBagConstraints.WEST;
		gbc_lblEmDiplomas.insets = new Insets(3, 25, 5, 5);
		gbc_lblEmDiplomas.gridx = 2;
		gbc_lblEmDiplomas.gridy = 8;
		panelBody.add(lblEmDiplomas, gbc_lblEmDiplomas);
		
		lblDiplomas = new JLabel(em.getDiplomasName());
		lblDiplomas.setFont(UtilityGUI.fontLblForm);
		lblDiplomas.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblDiplomas = new GridBagConstraints();
		gbc_lblDiplomas.anchor = GridBagConstraints.WEST;
		gbc_lblDiplomas.insets = new Insets(3, 0, 5, 5);
		gbc_lblDiplomas.gridx = 3;
		gbc_lblDiplomas.gridy = 8;
		panelBody.add(lblDiplomas, gbc_lblDiplomas);
		
		
		//	panelTitle2	
		panelTitle2 = UtilityGUI.titleForm("Thông Tin Sự Nghiệp");
		GridBagConstraints gbc_panelTitle2 = new GridBagConstraints();
		gbc_panelTitle2.insets = new Insets(10, 0, 10, 0);
		gbc_panelTitle2.fill = GridBagConstraints.BOTH;
		gbc_panelTitle2.gridx = 0;
		gbc_panelTitle2.gridy = 9;
		gbc_panelTitle2.gridwidth = 5;
		panelBody.add(panelTitle2, gbc_panelTitle2);
		
		lblEmDep = new JLabel("Phòng Ban :");
		lblEmDep.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmDep = new GridBagConstraints();
		gbc_lblEmDep.anchor = GridBagConstraints.WEST;
		gbc_lblEmDep.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmDep.gridx = 0;
		gbc_lblEmDep.gridy = 10;
		panelBody.add(lblEmDep, gbc_lblEmDep);
		
		lblDep = new JLabel(em.getDepName());
		lblDep.setFont(UtilityGUI.fontLblForm);
		lblDep.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblDep = new GridBagConstraints();
		gbc_lblDep.gridwidth = 3;
		gbc_lblDep.anchor = GridBagConstraints.WEST;
		gbc_lblDep.insets = new Insets(3, 0, 5, 5);
		gbc_lblDep.gridx = 1;
		gbc_lblDep.gridy = 10;
		panelBody.add(lblDep, gbc_lblDep);
		
		lblEmPos = new JLabel("Chức Vụ :");
		lblEmPos.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmPos = new GridBagConstraints();
		gbc_lblEmPos.anchor = GridBagConstraints.WEST;
		gbc_lblEmPos.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmPos.gridx = 0;
		gbc_lblEmPos.gridy = 11;
		panelBody.add(lblEmPos, gbc_lblEmPos);
		
		lblPos = new JLabel(em.getPosName());
		lblPos.setFont(UtilityGUI.fontLblForm);
		lblPos.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblPos = new GridBagConstraints();
		gbc_lblPos.anchor = GridBagConstraints.WEST;
		gbc_lblPos.insets = new Insets(3, 0, 5, 5);
		gbc_lblPos.gridx = 1;
		gbc_lblPos.gridy = 11;
		panelBody.add(lblPos, gbc_lblPos);
		
		lblEmT = new JLabel("Nghiệp Vụ :");
		lblEmT.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmT = new GridBagConstraints();
		gbc_lblEmT.anchor = GridBagConstraints.WEST;
		gbc_lblEmT.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmT.gridx = 0;
		gbc_lblEmT.gridy = 12;
		panelBody.add(lblEmT, gbc_lblEmT);
		
		lblType = new JLabel(em.getEmTName());
		lblType.setFont(UtilityGUI.fontLblForm);
		lblType.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblType = new GridBagConstraints();
		gbc_lblType.anchor = GridBagConstraints.WEST;
		gbc_lblType.insets = new Insets(3, 0, 5, 5);
		gbc_lblType.gridx = 1;
		gbc_lblType.gridy = 12;
		panelBody.add(lblType, gbc_lblType);
		
		lblEmDateStart = new JLabel("Ngày Bắt Đầu :");
		lblEmDateStart.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmDateStart = new GridBagConstraints();
		gbc_lblEmDateStart.anchor = GridBagConstraints.WEST;
		gbc_lblEmDateStart.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmDateStart.gridx = 0;
		gbc_lblEmDateStart.gridy = 13;
		panelBody.add(lblEmDateStart, gbc_lblEmDateStart);
		
		lblDateStart = new JLabel(em.getEmDateStart());
		lblDateStart.setFont(UtilityGUI.fontLblForm);
		lblDateStart.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblDateStart = new GridBagConstraints();
		gbc_lblDateStart.anchor = GridBagConstraints.WEST;
		gbc_lblDateStart.insets = new Insets(3, 0, 5, 5);
		gbc_lblDateStart.gridx = 1;
		gbc_lblDateStart.gridy = 13;
		panelBody.add(lblDateStart, gbc_lblDateStart);
		
		lblEmDateEnd = new JLabel("Ngày Kết Thúc :");
		lblEmDateEnd.setFont(UtilityGUI.fontHeader3);
		GridBagConstraints gbc_lblEmDateEnd = new GridBagConstraints();
		gbc_lblEmDateEnd.anchor = GridBagConstraints.WEST;
		gbc_lblEmDateEnd.insets = new Insets(3, 20, 5, 5);
		gbc_lblEmDateEnd.gridx = 0;
		gbc_lblEmDateEnd.gridy = 14;
		panelBody.add(lblEmDateEnd, gbc_lblEmDateEnd);
		
		lblDateEnd = new JLabel(em.getEmDateEnd());
		lblDateEnd.setFont(UtilityGUI.fontLblForm);
		lblDateEnd.setForeground(UtilityGUI.colorLblForm);
		GridBagConstraints gbc_lblDateEnd = new GridBagConstraints();
		gbc_lblDateEnd.anchor = GridBagConstraints.WEST;
		gbc_lblDateEnd.insets = new Insets(3, 0, 5, 5);
		gbc_lblDateEnd.gridx = 1;
		gbc_lblDateEnd.gridy = 14;
		panelBody.add(lblDateEnd, gbc_lblDateEnd);
		
		for(int i =0; i<Login.listAuthorization.size(); i++){
			if(Login.listAuthorization.get(i).getModuleName().equals("Employee") &&
					Login.listAuthorization.get(i).getPermName().equals("Edit") &&
					Login.listAuthorization.get(i).getModuleDep() == em.getDepId()){
				btnEmEdit = new JButton("Sửa Thông Tin");
				btnEmEdit.setFont(UtilityGUI.fontBtnForm);
				btnEmEdit.addActionListener(this);
				GridBagConstraints gbc_btnEmEdit = new GridBagConstraints();
				gbc_btnEmEdit.anchor = GridBagConstraints.NORTHWEST;
				gbc_btnEmEdit.insets = new Insets(15, 20, 10, 5);
				gbc_btnEmEdit.gridx = 0;
				gbc_btnEmEdit.gridy = 15;
				panelBody.add(btnEmEdit, gbc_btnEmEdit);
				break;
			}
		}

		btnReport = new JButton("Xuất Báo Cáo");
		btnReport.setFont(UtilityGUI.fontBtnForm);
		btnReport.addActionListener(this);
		GridBagConstraints gbc_btnReport = new GridBagConstraints();
		gbc_btnReport.anchor = GridBagConstraints.NORTHWEST;
		gbc_btnReport.insets = new Insets(15, 5, 10, 5);
		gbc_btnReport.gridx = 1;
		gbc_btnReport.gridy = 15;
		panelBody.add(btnReport, gbc_btnReport);
		
		btnNext = new JButton("Bảng Lương - Chấm Công", UtilityGUI.iconNext);
		btnNext.setHorizontalTextPosition(SwingConstants.LEFT);
		btnNext.setFont(UtilityGUI.fontBtnForm);
		btnNext.addActionListener(this);		
		GridBagConstraints gbc_btnNext = new GridBagConstraints();
		gbc_btnNext.anchor = GridBagConstraints.NORTHEAST;
		gbc_btnNext.insets = new Insets(15, 20, 10, 25);
		gbc_btnNext.gridx = 4;
		gbc_btnNext.gridy = 15;
		panelBody.add(btnNext, gbc_btnNext);		
		
		return panelBody;
	}
	
	/**
	 * panel condition Employee TimeSheet - SalarySheet
	 * @param em
	 * @return
	 */
	private JPanel initPanelTS_SS(EmployeeInfo em) {
		panelBody = new JPanel();
		GridBagLayout gbl_panelBody = new GridBagLayout();
		gbl_panelBody.columnWidths = new int[]{0};
		gbl_panelBody.rowHeights = new int[]{0, 0, 0};
		gbl_panelBody.columnWeights = new double[]{1.0};
		gbl_panelBody.rowWeights = new double[]{0.0, 0.0, 1.0};
		panelBody.setLayout(gbl_panelBody);
		
		panelOption = new JPanel();
		GridBagConstraints gbc_panel = new GridBagConstraints();
		gbc_panel.insets = new Insets(5, 20, 5, 20);
		gbc_panel.fill = GridBagConstraints.BOTH;
		gbc_panel.gridx = 0;
		gbc_panel.gridy = 0;
		panelBody.add(panelOption, gbc_panel);
			
		lblMonth = new JLabel("Tháng :");
		panelOption.add(lblMonth);
		lblMonth.setFont(UtilityGUI.fontHeader3);
		
		monthChooser = new JMonthChooser();
		monthChooser.setFont(UtilityGUI.fontComboBox);
		panelOption.add(monthChooser);
		monthChooser.setLocale(new Locale("vi"));
		monthChooser.getComboBox().setPreferredSize(new Dimension(120, 22));
		
		
		rdbtnOption = new JRadioButton("Tháng 13(Tết)");
		rdbtnOption.setFont(UtilityGUI.fontHeader3);
		rdbtnOption.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent e) {
				AbstractButton aButton = (AbstractButton)e.getSource();
		        ButtonModel aModel = aButton.getModel();
		        boolean selected = aModel.isSelected();
		        if(selected){
		        	monthChooser.setEnabled(false);
		        }else{
		        	monthChooser.setEnabled(true);
		        }
			}
		});
		panelOption.add(rdbtnOption);
			
		lblYear = new JLabel("Năm :");
		lblYear.setFont(UtilityGUI.fontHeader3);
		panelOption.add(lblYear);
		
		
		yearChooser = new JYearChooser();
		yearChooser.setEndYear(Main.fullday.getYear()+1900);
		yearChooser.setStartYear(2000);
		yearChooser.setFont(UtilityGUI.fontComboBox);
		panelOption.add(yearChooser);
		
		btnView = new JButton("Xem");
		panelOption.add(btnView);
		btnView.setFont(UtilityGUI.fontBtnForm);
		btnView.addActionListener(this);
		
		btnPrev = new JButton("Thông Tin Nhân Viên", UtilityGUI.iconBack);
		btnPrev.setHorizontalTextPosition(SwingConstants.RIGHT);
		btnPrev.setFont(UtilityGUI.fontBtnForm);
		btnPrev.addActionListener(this);
		GridBagConstraints gbc_btnPrev = new GridBagConstraints();
		gbc_btnPrev.anchor = GridBagConstraints.NORTHEAST;
		gbc_btnPrev.gridx = 0;
		gbc_btnPrev.gridy = 2;
		gbc_btnPrev.insets = new Insets(15, 20, 10, 25);	
		panelBody.add(btnPrev, gbc_btnPrev);
//--------------------------------------------------------------------
		
		return panelBody;
	}
	
	/**
	 * panel content Employee TimeSheet - SalarySheet
	 * @param monthYear
	 * @param emSS
	 * @param emTS
	 */
	public void getPanelTSSS(String monthYear, EmSalarySheet emSS, Vector<EmTimeSheet> emTS){
		panelTSSS = new JPanel();
		GridBagConstraints gbc_panelTSSS = new GridBagConstraints();
		gbc_panelTSSS.fill = GridBagConstraints.BOTH;
		gbc_panelTSSS.anchor = GridBagConstraints.CENTER;
		gbc_panelTSSS.insets = new Insets(3, 10, 5, 10);
		gbc_panelTSSS.gridx = 0;
		gbc_panelTSSS.gridy = 1;
		panelBody.add(panelTSSS, gbc_panelTSSS);
		GridBagLayout gbl_panelTSSS = new GridBagLayout();
		gbl_panelTSSS.columnWidths = new int[]{0, 0};
		gbl_panelTSSS.rowHeights = new int[]{0, 0};
		gbl_panelTSSS.columnWeights = new double[]{0.0, 1.0};
		gbl_panelTSSS.rowWeights = new double[]{0.0, 1.0};
		panelTSSS.setLayout(gbl_panelTSSS);
		
		my = monthYear;
		panelMonthYear = UtilityGUI.titleForm("Tháng : "+ my);
		GridBagConstraints gbc_panelMonthYear = new GridBagConstraints();
		gbc_panelMonthYear.fill = GridBagConstraints.BOTH;
		gbc_panelMonthYear.anchor = GridBagConstraints.WEST;
		gbc_panelMonthYear.insets = new Insets(0, 0, 10, 0);
		gbc_panelMonthYear.gridwidth = 2;
		gbc_panelMonthYear.gridx = 0;
		gbc_panelMonthYear.gridy = 0;
		panelTSSS.add(panelMonthYear, gbc_panelMonthYear);
		
		if(!my.contains("13")){
			tblEmTS = UtilityGUI.getTblEmTs(emTS, monthYear);
			scrollTblTS = new JScrollPane();
			scrollTblTS.setPreferredSize(new Dimension(360, 648));
			scrollTblTS.setViewportView(tblEmTS);
			GridBagConstraints gbc_scrollTblTS = new GridBagConstraints();
			gbc_scrollTblTS.insets = new Insets(0, 10, 0, 5);
			gbc_scrollTblTS.fill = GridBagConstraints.BOTH;
			gbc_scrollTblTS.gridx = 0;
			gbc_scrollTblTS.gridy = 1;
			panelTSSS.add(scrollTblTS, gbc_scrollTblTS);
		}
		
		panelSS = new JPanel();
		GridBagConstraints gbc_panelSS = new GridBagConstraints();
		gbc_panelSS.fill = GridBagConstraints.BOTH;
		gbc_panelSS.gridy = 1;
		if(!my.contains("13")){
			gbc_panelSS.gridx = 1;
			gbc_panelSS.insets = new Insets(0, 5, 0, 10);
		}else{
			gbc_panelSS.gridx = 0;
			gbc_panelSS.gridwidth = 2;
			gbc_panelSS.insets = new Insets(0, 20, 0, 20);
		}
		panelTSSS.add(panelSS, gbc_panelSS);
		GridBagLayout gbl_panelSS = new GridBagLayout();
		gbl_panelSS.columnWidths = new int[]{0, 0};
		gbl_panelSS.columnWeights = new double[]{0.0, 1.0};
		gbl_panelSS.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0};
		gbl_panelSS.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0};
		panelSS.setLayout(gbl_panelSS);
		if(emSS.getEmId() == null){
			lblNote = new JLabel(UtilityGUI.noticeSalary);
			lblNote.setFont(UtilityGUI.fontLblForm);
			lblNote.setForeground(UtilityGUI.colorNote);
			GridBagConstraints gbc_lblNote = new GridBagConstraints();
			gbc_lblNote.anchor = GridBagConstraints.WEST;
			gbc_lblNote.insets = new Insets(3, 5, 5, 5);
			gbc_lblNote.gridx = 0;
			gbc_lblNote.gridy = 0;
			gbc_lblNote.gridwidth = 2;
			panelSS.add(lblNote, gbc_lblNote);
		}else{
			if(!my.contains("13")){
				lblTotalAM = new JLabel("Tổng Số Ngày Làm Sáng :");
				lblTotalAM.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblTotalAM = new GridBagConstraints();
				gbc_lblTotalAM.anchor = GridBagConstraints.WEST;
				gbc_lblTotalAM.insets = new Insets(3, 5, 5, 5);
				gbc_lblTotalAM.gridx = 0;
				gbc_lblTotalAM.gridy = 0;
				panelSS.add(lblTotalAM, gbc_lblTotalAM);
				
				lbl_TotalAM = new JLabel(emSS.getTotalAM());
				lbl_TotalAM.setFont(UtilityGUI.fontLblForm);
				lbl_TotalAM.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_TotalAM = new GridBagConstraints();
				gbc_lbl_TotalAM.anchor = GridBagConstraints.WEST;
				gbc_lbl_TotalAM.insets = new Insets(3, 0, 5, 0);
				gbc_lbl_TotalAM.gridx = 1;
				gbc_lbl_TotalAM.gridy = 0;
				panelSS.add(lbl_TotalAM, gbc_lbl_TotalAM);
				
				lblSCAM = new JLabel("Hệ Số Lương Ca Sáng :");
				lblSCAM.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSCAM = new GridBagConstraints();
				gbc_lblSCAM.insets = new Insets(3, 5, 5, 5);
				gbc_lblSCAM.anchor = GridBagConstraints.WEST;
				gbc_lblSCAM.gridx = 0;
				gbc_lblSCAM.gridy = 1;
				panelSS.add(lblSCAM, gbc_lblSCAM);
				
				lbl_SCAM = new JLabel(emSS.getScAM());
				lbl_SCAM.setFont(UtilityGUI.fontLblForm);
				lbl_SCAM.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SCAM = new GridBagConstraints();
				gbc_lbl_SCAM.anchor = GridBagConstraints.WEST;
				gbc_lbl_SCAM.insets = new Insets(3, 0, 5, 0);
				gbc_lbl_SCAM.gridx = 1;
				gbc_lbl_SCAM.gridy = 1;
				panelSS.add(lbl_SCAM, gbc_lbl_SCAM);
				
				lblSalaryAM = new JLabel("Tổng Lương Ca Sáng :");
				lblSalaryAM.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSalaryAM = new GridBagConstraints();
				gbc_lblSalaryAM.anchor = GridBagConstraints.WEST;
				gbc_lblSalaryAM.insets = new Insets(3, 5, 5, 5);
				gbc_lblSalaryAM.gridx = 0;
				gbc_lblSalaryAM.gridy = 2;
				panelSS.add(lblSalaryAM, gbc_lblSalaryAM);
				
				lbl_SalaryAM = new JLabel(emSS.getSalaryAM());
				lbl_SalaryAM.setFont(UtilityGUI.fontLblForm);
				lbl_SalaryAM.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SalaryAM = new GridBagConstraints();
				gbc_lbl_SalaryAM.anchor = GridBagConstraints.WEST;
				gbc_lbl_SalaryAM.insets = new Insets(3, 0, 5, 0);
				gbc_lbl_SalaryAM.gridx = 1;
				gbc_lbl_SalaryAM.gridy = 2;
				panelSS.add(lbl_SalaryAM, gbc_lbl_SalaryAM);
				
				lblTotalPM = new JLabel("Tổng Số Ngày Làm Đêm :");
				lblTotalPM.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblTotalPM = new GridBagConstraints();
				gbc_lblTotalPM.anchor = GridBagConstraints.WEST;
				gbc_lblTotalPM.insets = new Insets(20, 5, 5, 5);
				gbc_lblTotalPM.gridx = 0;
				gbc_lblTotalPM.gridy = 3;
				panelSS.add(lblTotalPM, gbc_lblTotalPM);
				
				lbl_TotalPM = new JLabel(emSS.getTotalPM());
				lbl_TotalPM.setFont(UtilityGUI.fontLblForm);
				lbl_TotalPM.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_TotalPM = new GridBagConstraints();
				gbc_lbl_TotalPM.anchor = GridBagConstraints.WEST;
				gbc_lbl_TotalPM.insets = new Insets(20, 0, 5, 0);
				gbc_lbl_TotalPM.gridx = 1;
				gbc_lbl_TotalPM.gridy = 3;
				panelSS.add(lbl_TotalPM, gbc_lbl_TotalPM);
				
				lblSCPM = new JLabel("Hệ Số Lương Ca Đêm :");
				lblSCPM.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSCPM = new GridBagConstraints();
				gbc_lblSCPM.anchor = GridBagConstraints.WEST;
				gbc_lblSCPM.insets = new Insets(3, 5, 5, 5);
				gbc_lblSCPM.gridx = 0;
				gbc_lblSCPM.gridy = 4;
				panelSS.add(lblSCPM, gbc_lblSCPM);
				
				lbl_SCPM = new JLabel(emSS.getScPM());
				lbl_SCPM.setFont(UtilityGUI.fontLblForm);
				lbl_SCPM.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SCPM = new GridBagConstraints();
				gbc_lbl_SCPM.anchor = GridBagConstraints.WEST;
				gbc_lbl_SCPM.insets = new Insets(3, 0, 5, 0);
				gbc_lbl_SCPM.gridx = 1;
				gbc_lbl_SCPM.gridy = 4;
				panelSS.add(lbl_SCPM, gbc_lbl_SCPM);
				
				lblSalaryPM = new JLabel("Tổng Lương Ca Đêm :");
				lblSalaryPM.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSalaryPM = new GridBagConstraints();
				gbc_lblSalaryPM.insets = new Insets(3, 5, 5, 5);
				gbc_lblSalaryPM.anchor = GridBagConstraints.WEST;
				gbc_lblSalaryPM.gridx = 0;
				gbc_lblSalaryPM.gridy = 5;
				panelSS.add(lblSalaryPM, gbc_lblSalaryPM);
				
				lbl_SalaryPM = new JLabel(emSS.getSalaryPM());
				lbl_SalaryPM.setFont(UtilityGUI.fontLblForm);
				lbl_SalaryPM.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SalaryPM = new GridBagConstraints();
				gbc_lbl_SalaryPM.anchor = GridBagConstraints.WEST;
				gbc_lbl_SalaryPM.insets = new Insets(3, 0, 5, 0);
				gbc_lbl_SalaryPM.gridx = 1;
				gbc_lbl_SalaryPM.gridy = 5;
				panelSS.add(lbl_SalaryPM, gbc_lbl_SalaryPM);
				
				lblSB = new JLabel("Thưởng :");
				lblSB.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSB = new GridBagConstraints();
				gbc_lblSB.insets = new Insets(20, 5, 5, 5);
				gbc_lblSB.anchor = GridBagConstraints.WEST;
				gbc_lblSB.gridx = 0;
				gbc_lblSB.gridy = 6;
				panelSS.add(lblSB, gbc_lblSB);
				
				lbl_SB = new JLabel(emSS.getSb());
				lbl_SB.setFont(UtilityGUI.fontLblForm);
				lbl_SB.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SB = new GridBagConstraints();
				gbc_lbl_SB.anchor = GridBagConstraints.WEST;
				gbc_lbl_SB.insets = new Insets(20, 0, 5, 0);
				gbc_lbl_SB.gridx = 1;
				gbc_lbl_SB.gridy = 6;
				panelSS.add(lbl_SB, gbc_lbl_SB);
				
				lblPercent = new JLabel("Mức Lương Hiện Tại :");
				lblPercent.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblPercent = new GridBagConstraints();
				gbc_lblPercent.insets = new Insets(20, 5, 5, 5);
				gbc_lblPercent.anchor = GridBagConstraints.WEST;
				gbc_lblPercent.gridx = 0;
				gbc_lblPercent.gridy = 7;
				panelSS.add(lblPercent, gbc_lblPercent);
				
				lbl_Percent = new JLabel(emSS.getContractBenefit()+" lương chính thức");
				lbl_Percent.setFont(UtilityGUI.fontLblForm);
				lbl_Percent.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_Percent = new GridBagConstraints();
				gbc_lbl_Percent.anchor = GridBagConstraints.WEST;
				gbc_lbl_Percent.insets = new Insets(20, 0, 5, 0);
				gbc_lbl_Percent.gridx = 1;
				gbc_lbl_Percent.gridy = 7;
				panelSS.add(lbl_Percent, gbc_lbl_Percent);
				
				lblTotalSalary = new JLabel("Tổng Lương :");
				lblTotalSalary.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblTotalSalary = new GridBagConstraints();
				gbc_lblTotalSalary.insets = new Insets(20, 5, 0, 5);
				gbc_lblTotalSalary.anchor = GridBagConstraints.NORTHWEST;
				gbc_lblTotalSalary.gridx = 0;
				gbc_lblTotalSalary.gridy = 8;
				panelSS.add(lblTotalSalary, gbc_lblTotalSalary);
				
				lbl_TotalSalary = new JLabel(emSS.getTotalSalary());
				lbl_TotalSalary.setFont(UtilityGUI.fontLblForm);
				lbl_TotalSalary.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_TotalSalary = new GridBagConstraints();
				gbc_lbl_TotalSalary.anchor = GridBagConstraints.NORTHWEST;
				gbc_lbl_TotalSalary.insets = new Insets(20, 0, 0, 0);
				gbc_lbl_TotalSalary.gridx = 1;
				gbc_lbl_TotalSalary.gridy = 8;
				panelSS.add(lbl_TotalSalary, gbc_lbl_TotalSalary);
			}else{
				lblSCYear = new JLabel("Hệ Số Lương Tết:");
				lblSCYear.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSCYear = new GridBagConstraints();
				gbc_lblSCYear.anchor = GridBagConstraints.WEST;
				gbc_lblSCYear.insets = new Insets(3, 5, 5, 5);
				gbc_lblSCYear.gridx = 0;
				gbc_lblSCYear.gridy = 0;
				panelSS.add(lblSCYear, gbc_lblSCYear);
				
				lbl_SCYear = new JLabel(emSS.getScYear());
				lbl_SCYear.setFont(UtilityGUI.fontLblForm);
				lbl_SCYear.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SCYear = new GridBagConstraints();
				gbc_lbl_SCYear.anchor = GridBagConstraints.WEST;
				gbc_lbl_SCYear.insets = new Insets(3, 0, 5, 0);
				gbc_lbl_SCYear.gridx = 1;
				gbc_lbl_SCYear.gridy = 0;
				panelSS.add(lbl_SCYear, gbc_lbl_SCYear);
				
				lblPercent = new JLabel("Mức Lương Hiện Tại :");
				lblPercent.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblPercent = new GridBagConstraints();
				gbc_lblPercent.insets = new Insets(20, 5, 5, 5);
				gbc_lblPercent.anchor = GridBagConstraints.WEST;
				gbc_lblPercent.gridx = 0;
				gbc_lblPercent.gridy = 1;
				panelSS.add(lblPercent, gbc_lblPercent);
				
				lbl_Percent = new JLabel(emSS.getContractBenefit()+" lương chính thức");
				lbl_Percent.setFont(UtilityGUI.fontLblForm);
				lbl_Percent.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_Percent = new GridBagConstraints();
				gbc_lbl_Percent.anchor = GridBagConstraints.WEST;
				gbc_lbl_Percent.insets = new Insets(20, 0, 5, 0);
				gbc_lbl_Percent.gridx = 1;
				gbc_lbl_Percent.gridy = 1;
				panelSS.add(lbl_Percent, gbc_lbl_Percent);
				
				lblSalaryYear = new JLabel("Lương Tết :");
				lblSalaryYear.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSalaryYear = new GridBagConstraints();
				gbc_lblSalaryYear.insets = new Insets(20, 5, 5, 5);
				gbc_lblSalaryYear.anchor = GridBagConstraints.WEST;
				gbc_lblSalaryYear.gridx = 0;
				gbc_lblSalaryYear.gridy = 2;
				panelSS.add(lblSalaryYear, gbc_lblSalaryYear);
				
				lbl_SalaryYear = new JLabel(emSS.getSalaryYear());
				lbl_SalaryYear.setFont(UtilityGUI.fontLblForm);
				lbl_SalaryYear.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SalaryYear = new GridBagConstraints();
				gbc_lbl_SalaryYear.anchor = GridBagConstraints.WEST;
				gbc_lbl_SalaryYear.insets = new Insets(20, 0, 5, 0);
				gbc_lbl_SalaryYear.gridx = 1;
				gbc_lbl_SalaryYear.gridy = 2;
				panelSS.add(lbl_SalaryYear, gbc_lbl_SalaryYear);
				
				lblSB = new JLabel("Thưởng :");
				lblSB.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblSB = new GridBagConstraints();
				gbc_lblSB.insets = new Insets(20, 5, 5, 5);
				gbc_lblSB.anchor = GridBagConstraints.WEST;
				gbc_lblSB.gridx = 0;
				gbc_lblSB.gridy = 3;
				panelSS.add(lblSB, gbc_lblSB);
				
				lbl_SB = new JLabel(emSS.getSb());
				lbl_SB.setFont(UtilityGUI.fontLblForm);
				lbl_SB.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_SB = new GridBagConstraints();
				gbc_lbl_SB.anchor = GridBagConstraints.WEST;
				gbc_lbl_SB.insets = new Insets(20, 0, 5, 0);
				gbc_lbl_SB.gridx = 1;
				gbc_lbl_SB.gridy = 3;
				panelSS.add(lbl_SB, gbc_lbl_SB);
				
				lblTotalSalary = new JLabel("Tổng Lương :");
				lblTotalSalary.setFont(UtilityGUI.fontHeader3);
				GridBagConstraints gbc_lblTotalSalary = new GridBagConstraints();
				gbc_lblTotalSalary.insets = new Insets(20, 5, 0, 5);
				gbc_lblTotalSalary.anchor = GridBagConstraints.NORTHWEST;
				gbc_lblTotalSalary.gridx = 0;
				gbc_lblTotalSalary.gridy = 4;
				panelSS.add(lblTotalSalary, gbc_lblTotalSalary);
				
				lbl_TotalSalary = new JLabel(emSS.getTotalSalary());
				lbl_TotalSalary.setFont(UtilityGUI.fontLblForm);
				lbl_TotalSalary.setForeground(UtilityGUI.colorLblForm);
				GridBagConstraints gbc_lbl_TotalSalary = new GridBagConstraints();
				gbc_lbl_TotalSalary.anchor = GridBagConstraints.NORTHWEST;
				gbc_lbl_TotalSalary.insets = new Insets(20, 0, 0, 0);
				gbc_lbl_TotalSalary.gridx = 1;
				gbc_lbl_TotalSalary.gridy = 4;
				panelSS.add(lbl_TotalSalary, gbc_lbl_TotalSalary);
			}
		}
	}
	
	
	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource()==btnReport){
			WriteExcel test = new WriteExcel();
			Vector<Vector<String>> duLieu = new Vector<Vector<String>>();
			for (int k = 0; k < vt.size(); k++) {
				Vector<String> phanTu = new Vector<String>();
				phanTu.add(vt.get(k).getEmId()); 
				phanTu.add(vt.get(k).getEmFullName()); 
				phanTu.add(vt.get(k).getDepName()); 
				phanTu.add(vt.get(k).getPosName());
				phanTu.add(vt.get(k).getEmSex());
				phanTu.add(vt.get(k).getEmBirthDay());
				phanTu.add(vt.get(k).getEmPhone());
				phanTu.add(vt.get(k).getEmCur());
				phanTu.add(vt.get(k).getSpecName());
				phanTu.add(vt.get(k).getDiplomasName());
				phanTu.add(vt.get(k).getEmDateStart());
				phanTu.add(vt.get(k).getEmDateEnd());
				duLieu.add(phanTu);
			}
			test.writeListEmInfo(6, duLieu, 1, "src/excel/Temp.xls");
		}
		if(e.getSource() == btnNext){
			panelBody.setVisible(false);
			panelBody.removeAll();
			panelMain.remove(initPanelInfo(em));
			panelMain.add(initPanelTS_SS(em));
			return;
		}
		if(e.getSource() == btnPrev){
			panelBody.setVisible(false);
			panelBody.removeAll();
			panelMain.remove(initPanelTS_SS(em));
			panelMain.add(initPanelInfo(em));
			return;
		}
		if(e.getSource() == btnView){
			String monthYear;
			if(rdbtnOption.isSelected()){
				monthYear = DayMonthYear.monthYear(13, yearChooser.getYear());
				if(flag == true){
					if(monthYear.equals(my)){
						return;
					}
					if(!monthYear.equals(my)){
						panelTSSS.setVisible(false);
						panelTSSS.removeAll();
						panelBody.remove(panelTSSS);						
					}
				}
				EmSalarySheet emSS = Main.viewEm.getEmSalarySheet(monthYear, em.getEmId());
				System.out.println();
				btnPrev.setVisible(false);
				getPanelTSSS(monthYear, emSS, null);
				btnPrev = new JButton("Thông Tin Nhân Viên", new ImageIcon("src/image/back.png"));
				btnPrev.setHorizontalTextPosition(SwingConstants.RIGHT);
				btnPrev.setFont(UtilityGUI.fontBtnForm);
				btnPrev.addActionListener(this);
				GridBagConstraints gbc_btnPrev = new GridBagConstraints();
				gbc_btnPrev.anchor = GridBagConstraints.NORTHEAST;
				gbc_btnPrev.gridx = 0;
				gbc_btnPrev.gridy = 2;
				gbc_btnPrev.insets = new Insets(15, 20, 10, 20);	
				panelBody.add(btnPrev, gbc_btnPrev);
				flag = true;
			}else{
				if(monthChooser.getMonth() > Main.fullday.getMonth() && yearChooser.getYear() == Main.fullday.getYear()+1900){
					JOptionPane.showMessageDialog(null, "Ko chọn thời điểm tương lai!!!", 
									UtilityGUI.titleAlert, JOptionPane.ERROR_MESSAGE);
					monthChooser.getComboBox().requestFocusInWindow();
					if(panelTSSS != null){
						panelTSSS.setVisible(false);
						panelBody.remove(panelTSSS);
						panelTSSS.removeAll();
					}
					return;
				}else{
					monthYear = DayMonthYear.monthYear(monthChooser.getMonth()+1, yearChooser.getYear());
					if(flag == true){
						if(monthYear.equals(my)){
							return;
						}
						if(!monthYear.equals(my)){
							panelTSSS.setVisible(false);
							panelTSSS.removeAll();
							panelBody.remove(panelTSSS);						
						}
					}
					Vector<EmTimeSheet> emTS = Main.viewEm.getEmTimeSheet(monthYear, em.getEmId());
					if(emTS.size() == 0 || emTS == null){
						JOptionPane.showMessageDialog(null, "Ko có dữ liệu !", 
								UtilityGUI.titleAlert, JOptionPane.ERROR_MESSAGE);
						if(panelTSSS != null){
							panelTSSS.setVisible(false);
							panelTSSS.removeAll();
							panelBody.remove(panelTSSS);
						}
						flag = false;
						return;
					}else if(emTS.size() != 0){
						EmSalarySheet emSS = Main.viewEm.getEmSalarySheet(monthYear, em.getEmId());
						System.out.println();
						btnPrev.setVisible(false);
						getPanelTSSS(monthYear, emSS, emTS);
						btnPrev = new JButton("Thông Tin Nhân Viên", new ImageIcon("src/image/back.png"));
						btnPrev.setHorizontalTextPosition(SwingConstants.RIGHT);
						btnPrev.setFont(UtilityGUI.fontBtnForm);
						btnPrev.addActionListener(this);
						GridBagConstraints gbc_btnPrev = new GridBagConstraints();
						gbc_btnPrev.anchor = GridBagConstraints.NORTHEAST;
						gbc_btnPrev.gridx = 0;
						gbc_btnPrev.gridy = 2;
						gbc_btnPrev.insets = new Insets(15, 20, 10, 20);	
						panelBody.add(btnPrev, gbc_btnPrev);
						flag = true;
					}
				}
			}
		}
		if(e.getSource() == btnEmEdit){
			int index = Main.jTabbedPane.positionTab(UtilityGUI.tabEmEdit);
			if(index == -1){
				Main.jTabbedPane.addTab(new Employee_Edit(em), UtilityGUI.tabEmEdit);
				Main.jTabbedPane.setSelectedIndex(Main.jTabbedPane.getTabCount()-1);
			}else{
				Main.jTabbedPane.setSelectedIndex(index);
				return;
			}
		}
	}
}
